<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class="span12">
				<div class="nonboxy-widget">
					<div class="widget-head">
						<h5><i class="black-icons blocks_images"></i><?php print $title?></h5>
					</div>
					<div class="widget-content">
						<div class="widget-box">
              <?php print $this->form_eksternal->form_open("", 'class=" form-horizontal well" id="formoutlet"')?>
								<fieldset>
                  <div class="control-group">
										<label class="control-label">Persentase / Account</label>
										<div class="controls">
                      <?php 
//                      print $this->form_eksternal->form_addrow_autocomplate("account[]", "id_frm_account[]", "account_1", site_url("budjeting/add-row"), 
//                              "mul_account", "add_account", "nomor", $tr, "account_hidden_1", site_url("frm/accounting/auto_account"), $value, 
//                              $value_hidden);
//                        print $this->form_eksternal->form_input("percent[]", "");
                      $no = 1;
                      foreach($budjet AS $bd){
                        $cetak[] = $this->form_eksternal->form_input("percent[]", $bd->persen).
                                  $this->form_eksternal->form_autocomplate("frm_account[]", "id_frm_account[]", "frm_account_$no", "id_frm_account_$no", 
                                          site_url("frm/accounting/auto_account"), $this->global_models->get_field("frm_account", "title", 
                                                  array("id_frm_account" => $bd->id_frm_account)), $bd->id_frm_account);
                        $no++;
                      }
                      print $this->form_eksternal->form_addrow_tambahan($cetak, site_url("budjeting/add-row"), "account", "body_account", "nomor", $tr);
                      ?>
										</div>
									</div>
								</fieldset>
								<div class="form-actions">
									<button class="btn btn-primary" type="submit">Save changes</button>
                  <a href="<?php print site_url("home")?>" class="btn"><?php print lang("cancel")?></a>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
</div>
<script>
  function del_row_tambahan(tr){
    $("#"+tr).remove();
  }
  function add_row_tambahan(table,url,act,param){
    var no = parseInt($('#'+param).val());
    $('#'+param).val(no+1);
    $.post(url,{no:$('#'+param).val(),action:act},function(data){
        $(data).clone(true).insertBefore("#"+table+" #"+act);
    });
  }
</script>